package com.itbac.springsecurityoauth2demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Springsecurityoauth2demoApplication {

	public static void main(String[] args) {
		SpringApplication.run(Springsecurityoauth2demoApplication.class, args);
	}
}

/**
 * 测试：
 *  @see com.itbac.springsecurityoauth2demo.service.SmartClientDetailsService#init()
 * 获取授权码：http://localhost:8080/oauth/authorize?client_id=admin&response_type=code&scope=all&redirect_uri=http://www.baidu.com
 *
 * @see com.itbac.springsecurityoauth2demo.service.SecurityUserService
 * 需要登录认证， 账户 bac 密码 123itbac
 *
 * 页面回调，拿到授权码 code
 * https://www.baidu.com/?code=UkBcF2
 *
 * 获取令牌 http://localhost:8080/oauth/token
 *
 * @see com.itbac.springsecurityoauth2demo.service.SmartClientDetailsService#init()
 * 需要表单提交以下参数
 * grant_type = authorization_code  固定的
 * redirect_uri = http://www.baidu.com
 * scope = all
 * client_id= admin
 * client_secret = 123456a
 * code = UkBcF2
 *
 * 访问 user服务：http://localhost:8080/user/getCurrentUser
 * 设置请求头Headers ,Bearer 是前缀，后面有个空格
 * Authorization = Bearer 6f32e2b4-70a1-467d-8c72-0c0883c3078e
 *
 *
 */
